import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/special_list/working_personnel_entity.dart';

WorkingPersonnelEntity $WorkingPersonnelEntityFromJson(Map<String, dynamic> json) {
  final WorkingPersonnelEntity workingPersonnelEntity = WorkingPersonnelEntity();
  final String? operatorUserId = jsonConvert.convert<String>(json['operatorUserId']);
  if (operatorUserId != null) {
    workingPersonnelEntity.operatorUserId = operatorUserId;
  }
  final String? operatorUserName = jsonConvert.convert<String>(json['operatorUserName']);
  if (operatorUserName != null) {
    workingPersonnelEntity.operatorUserName = operatorUserName;
  }
  final int? operatorType = jsonConvert.convert<int>(json['operatorType']);
  if (operatorType != null) {
    workingPersonnelEntity.operatorType = operatorType;
  }
  final String? operatorUserAvatar = jsonConvert.convert<String>(json['operatorUserAvatar']);
  if (operatorUserAvatar != null) {
    workingPersonnelEntity.operatorUserAvatar = operatorUserAvatar;
  }
  final String? operatorCertificateId = jsonConvert.convert<String>(json['operatorCertificateId']);
  if (operatorCertificateId != null) {
    workingPersonnelEntity.operatorCertificateId = operatorCertificateId;
  }
  final String? operatorCertificateNumber = jsonConvert.convert<String>(json['operatorCertificateNumber']);
  if (operatorCertificateNumber != null) {
    workingPersonnelEntity.operatorCertificateNumber = operatorCertificateNumber;
  }
  final String? operatorCertificateUrl = jsonConvert.convert<String>(json['operatorCertificateUrl']);
  if (operatorCertificateUrl != null) {
    workingPersonnelEntity.operatorCertificateUrl = operatorCertificateUrl;
  }
  return workingPersonnelEntity;
}

Map<String, dynamic> $WorkingPersonnelEntityToJson(WorkingPersonnelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['operatorUserId'] = entity.operatorUserId;
  data['operatorUserName'] = entity.operatorUserName;
  data['operatorType'] = entity.operatorType;
  data['operatorUserAvatar'] = entity.operatorUserAvatar;
  data['operatorCertificateId'] = entity.operatorCertificateId;
  data['operatorCertificateNumber'] = entity.operatorCertificateNumber;
  data['operatorCertificateUrl'] = entity.operatorCertificateUrl;
  return data;
}

extension WorkingPersonnelEntityExtension on WorkingPersonnelEntity {
  WorkingPersonnelEntity copyWith({
    String? operatorUserId,
    String? operatorUserName,
    int? operatorType,
    String? operatorUserAvatar,
    String? operatorCertificateId,
    String? operatorCertificateNumber,
    String? operatorCertificateUrl,
  }) {
    return WorkingPersonnelEntity()
      ..operatorUserId = operatorUserId ?? this.operatorUserId
      ..operatorUserName = operatorUserName ?? this.operatorUserName
      ..operatorType = operatorType ?? this.operatorType
      ..operatorUserAvatar = operatorUserAvatar ?? this.operatorUserAvatar
      ..operatorCertificateId = operatorCertificateId ?? this.operatorCertificateId
      ..operatorCertificateNumber = operatorCertificateNumber ?? this.operatorCertificateNumber
      ..operatorCertificateUrl = operatorCertificateUrl ?? this.operatorCertificateUrl;
  }
}
